HAL CORDIC constants migration

This section provides information about the HAL CORDIC constants migration.

HAL CORDIC DMA transfer directions constants

HAL1

HAL2

#define CORDIC_DMA_DIR_IN_OUT
#define CORDIC_DMA_DIR_IN
#define CORDIC_DMA_DIR_OUT
#define CORDIC_DMA_DIR_NONE

Removed; In HAL2 DMA direction management is handled internally.

Removed; In HAL2 use HAL_CORDIC_Write_DMA instead.

Removed; In HAL2 use HAL_CORDIC_Read_DMA instead.

Removed; In HAL2 configuring the CORDIC peripheral is simplified by enabling direct read and write access to its data registers from other peripherals.

For more details see layout


HAL CORDIC DMA Read/Write enable flags constants

HAL1

HAL2

#define CORDIC_DMA_REN
#define CORDIC_DMA_WEN

Removed; In HAL2, all DMA request management is handled internally . To manually control these bits, the following APIs are now available: LL_CORDIC_EnableDMAReq_RD, LL_CORDIC_DisableDMAReq_RD, LL_CORDIC_EnableDMAReq_WR and LL_CORDIC_DisableDMAReq_WR.


HAL CORDIC status flags constants

HAL1

HAL2

#define CORDIC_FLAG_RRDY

In HAL1, the defines are used by the macro __HAL_CORDIC_GET_FLAG(__HANDLE__, __FLAG__).

In HAL2, these defines and macros have been removed. Instead, use LL_CORDIC_IsActiveFlag() with the LL_CORDIC_FLAG_RRDY parameter, or directly use the function LL_CORDIC_IsActiveFlag_RRDY().

Related concept: Removal of hardware-related macros in HAL2


HAL CORDIC function modes constants

HAL1

HAL2



#define CORDIC_FUNCTION_COSINE
#define CORDIC_FUNCTION_SINE
#define CORDIC_FUNCTION_PHASE
#define CORDIC_FUNCTION_MODULUS
#define CORDIC_FUNCTION_ARCTANGENT
#define CORDIC_FUNCTION_HCOSINE
#define CORDIC_FUNCTION_HSINE
#define CORDIC_FUNCTION_HARCTANGENT
#define CORDIC_FUNCTION_NATURALLOG
#define CORDIC_FUNCTION_SQUAREROOT
typedef enum
{
 HAL_CORDIC_FUNCTION_COSINE,
 HAL_CORDIC_FUNCTION_SINE,
 HAL_CORDIC_FUNCTION_PHASE,
 HAL_CORDIC_FUNCTION_MODULUS,
 HAL_CORDIC_FUNCTION_ARCTANGENT,
 HAL_CORDIC_FUNCTION_HCOSINE,
 HAL_CORDIC_FUNCTION_HSINE,
 HAL_CORDIC_FUNCTION_HARCTANGENT,
 HAL_CORDIC_FUNCTION_NATURAL_LOG,
 HAL_CORDIC_FUNCTION_SQUARE_ROOT
} hal_cordic_function_t;

Related concepts :


HAL CORDIC input data sizes constants

HAL1

HAL2



#define CORDIC_INSIZE_32BITS
#define CORDIC_INSIZE_16BITS
typedef enum
{
  HAL_CORDIC_IN_WIDTH_32_BIT,
  HAL_CORDIC_IN_WIDTH_16_BIT
} hal_cordic_in_width_t;

Related concepts :


HAL CORDIC interrupt identifiers constants

HAL1

HAL2

#define CORDIC_IT_IEN

In HAL1, those defines are used by the __HAL_CORDIC_ENABLE_IT(__HANDLE__, __INTERRUPT__), __HAL_CORDIC_DISABLE_IT(__HANDLE__, __INTERRUPT__) and __HAL_CORDIC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) macros.

In HAL2, the IT defines and macros are removed, use LL_CORDIC_EnableIT() and LL_CORDIC_DisableIT() instead.

Related concept: Removal of hardware-related macros in HAL2


HAL CORDIC number of read operations constants

HAL1

HAL2



#define CORDIC_NBREAD_1
#define CORDIC_NBREAD_2
typedef enum
{
  HAL_CORDIC_NB_RESULT_1,
  HAL_CORDIC_NB_RESULT_2
} hal_cordic_nb_result_t;

Related concepts :


HAL CORDIC number of write operations constants

HAL1

HAL2



#define CORDIC_NBWRITE_1
#define CORDIC_NBWRITE_2
typedef enum
{
  HAL_CORDIC_NB_ARG_1,
  HAL_CORDIC_NB_ARG_2
} hal_cordic_nb_arg_t;

Related concepts :


HAL CORDIC output data size constants

HAL1

HAL2



#define CORDIC_OUTSIZE_32BITS
#define CORDIC_OUTSIZE_16BITS
typedef enum
{
  HAL_CORDIC_OUT_WIDTH_32_BIT,
  HAL_CORDIC_OUT_WIDTH_16_BIT
} hal_cordic_out_width_t;

Related concepts :


HAL CORDIC precision settings constants

HAL1

HAL2



#define CORDIC_PRECISION_1CYCLE
#define CORDIC_PRECISION_2CYCLES
#define CORDIC_PRECISION_3CYCLES
#define CORDIC_PRECISION_4CYCLES
#define CORDIC_PRECISION_5CYCLES
#define CORDIC_PRECISION_6CYCLES
#define CORDIC_PRECISION_7CYCLES
#define CORDIC_PRECISION_8CYCLES
#define CORDIC_PRECISION_9CYCLES
#define CORDIC_PRECISION_10CYCLES
#define CORDIC_PRECISION_11CYCLES
#define CORDIC_PRECISION_12CYCLES
#define CORDIC_PRECISION_13CYCLES
#define CORDIC_PRECISION_14CYCLES
#define CORDIC_PRECISION_15CYCLES
typedef enum
{
 HAL_CORDIC_PRECISION_1_CYCLE,
 HAL_CORDIC_PRECISION_2_CYCLE,
 HAL_CORDIC_PRECISION_3_CYCLE,
 HAL_CORDIC_PRECISION_4_CYCLE,
 HAL_CORDIC_PRECISION_5_CYCLE,
 HAL_CORDIC_PRECISION_6_CYCLE,
 HAL_CORDIC_PRECISION_7_CYCLE,
 HAL_CORDIC_PRECISION_8_CYCLE,
 HAL_CORDIC_PRECISION_9_CYCLE,
 HAL_CORDIC_PRECISION_10_CYCLE,
 HAL_CORDIC_PRECISION_11_CYCLE,
 HAL_CORDIC_PRECISION_12_CYCLE,
 HAL_CORDIC_PRECISION_13_CYCLE,
 HAL_CORDIC_PRECISION_14_CYCLE,
 HAL_CORDIC_PRECISION_15_CYCLE
} hal_cordic_precision_t;

Related concepts :


HAL CORDIC scale factor constants

HAL1

HAL2



#define CORDIC_SCALE_0
#define CORDIC_SCALE_1
#define CORDIC_SCALE_2
#define CORDIC_SCALE_3
#define CORDIC_SCALE_4
#define CORDIC_SCALE_5
#define CORDIC_SCALE_6
#define CORDIC_SCALE_7
typedef enum
{
 HAL_CORDIC_SCALING_FACTOR_0,
 HAL_CORDIC_SCALING_FACTOR_1,
 HAL_CORDIC_SCALING_FACTOR_2,
 HAL_CORDIC_SCALING_FACTOR_3,
 HAL_CORDIC_SCALING_FACTOR_4,
 HAL_CORDIC_SCALING_FACTOR_5,
 HAL_CORDIC_SCALING_FACTOR_6,
 HAL_CORDIC_SCALING_FACTOR_7
} hal_cordic_scaling_factor_t;

Related concepts :


HAL CORDIC error code constants

HAL1

HAL2

#define HAL_CORDIC_ERROR_NONE
#define HAL_CORDIC_ERROR_NONE
#define HAL_CORDIC_ERROR_DMA
#define HAL_CORDIC_ERROR_DMA
#define HAL_CORDIC_ERROR_INVALID_CALLBACK
#define HAL_CORDIC_ERROR_NOT_READY
#define HAL_CORDIC_ERROR_PARAM
#define HAL_CORDIC_ERROR_TIMEOUT

Removed; These kinds of logical errors are reported by the direct function return.

Related concept: